#!/usr/bin/env python3
# -*- coding=utf-8 -*-
# 题目：有两个磁盘文件A和B,各存放一行字母,
# 要求把这两个文件中的信息合并(按字母顺序排列),
# 输出到一个新文件C中。


def f1():
    l1 = ""
    l2 = ""
    with open("a.txt", "r") as f:
        l1 = f.readline()
    with open("b.txt", "r") as f:
        l2 = f.readline()
    with open("c.txt", "w") as f:
        s = sorted(l1 + l2)
        for x in s:
            f.write(f"{x} ")


f = f1
if __name__ == "__main__":
    f()
